/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = frct_detect_hash_init.c                            */
/*  NOTE      =                                                    */
/*  DATE      = 2016/04/20 by jikw                                 */
/*******************************************************************/
#include <CUnit/Basic.h>
#include <stdlib.h>

#include "frcomm.h"
#include "frmem.h"
#include "conntrack.h"
#include "frct_comm.h"
#include "apmtest_comm.h"
#include "frct_detect_hash.h"

#define APM_CT_DETECT_HASH_SIZE     256

extern Frhash_header* frct_detect_hash_init(unsigned int ui_table_size);
extern void frct_detect_hash_free(Frhash_header** pp_detect_hash);

static int __suite_init(void)
{

    return 0;
}

static int __suite_cleanup(void)
{

    return 0;
}

static void __case1(void)
{
    Frhash_header *p_header = NULL;
    
    p_header = frct_detect_hash_init(0);

    CU_ASSERT_PTR_NULL(p_header);

    return;
}

static void __case2(void)
{
    Frhash_header *p_header = NULL;
    
    p_header = frct_detect_hash_init(APM_CT_DETECT_HASH_SIZE);

frct_detect_hash_free(&p_header);

    return;
}

int add_suite_frct_detect_hash_init(void)
{
    CU_pSuite pSuite = NULL;

    if ((pSuite = CU_add_suite("frct_comm frct_detect_hash_init()", __suite_init, __suite_cleanup)) == NULL)
        return FR_FAIL;

    CU_add_test(pSuite, "case1", __case1);
    CU_add_test(pSuite, "case2", __case2);

    return FR_SUCC;
}
